import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'
import { ref } from 'vue'

const BASE_URL  = 'http://localhost:8080';
//8.1 配置根路径
window.BASE_URL = BASE_URL;
const app = createApp(App)
app.config.globalProperties.BASE_URL = BASE_URL

// 配置 axios 默认值
axios.defaults.baseURL = BASE_URL
axios.defaults.timeout = 5000
// 全局配置
app.config.globalProperties.$axios = axios

// 创建全局状态
const locationInfo = ref('')
app.provide('locationInfo', locationInfo)

app.use(router)
app.mount('#app')
